<?php
/**
 * ActivityBreaking.php
 * description:
 * Created by www.
 * User: SCF
 * Date: 2018/12/8 10:32
 *
 */

namespace App\Console\Commands\Activity;
use App\Services\ActivityService;

class ActivityBreaking extends BaseActivity
{
    protected $signature = self::PREFIX . 'activity_breaking {--hall_id=} {--prizeRepair=} {--start_time=} {--end_time=}';

    protected $description = '连续过关活动加载数据';

    public $activityName = "连续闯关活动";

    public $activityKey = "activity:breaking";


    public $templateID = 8;
    /**
     * 获取需要派奖的数据
     */
    public function statisticsData($activity,$hall_id,$start,$end){
        $startTime = $this->option('start_time');// 修复时间开始时间
        $endTime = $this->option('end_time');//修复时间结束时间
        if(!empty($startTime)){
            $start = str_replace('_', ' ',$startTime);
        }
        if(!empty($endTime) && $start<$endTime){
            $end = str_replace('_', ' ',$endTime);
        }
        ActivityService::addBreaking($activity,$hall_id,$start,$end);
    }

}